﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PhotoList.ascx.cs" Inherits="Linkmeme.Views.Shared.PhotoList" %>
    
    <asp:ListView ID="imgListView" runat="server" GroupItemCount='<%# ItemCount%>' GroupPlaceholderID="groupPlaceHolder" ItemPlaceholderID="itemPlaceHolder">
        <LayoutTemplate>
            <table>
                <asp:PlaceHolder runat="server" ID="groupPlaceHolder"></asp:PlaceHolder>
            </table>
        </LayoutTemplate> 
        <GroupTemplate>
            <tr>
                <asp:PlaceHolder runat="server" ID="itemPlaceHolder"></asp:PlaceHolder>
            </tr>    
        </GroupTemplate>
        <ItemTemplate>
            <td style="vertical-align:top;font-size:10px">
                 <%if (!IsGroupItem) 
                   {%>
                 <span><%# Eval("UserName")%></span>&nbsp;
                 <%} %>
                 <span>(<%# Eval("PubDate")%>)</span>
                 <br />
                 <a href='<%# Eval("Link")%>' target="_blank">
                    <img src='<%# Eval("Url")%>' alt='<%# Eval("Type")%>' width='<%# ((int)Eval("Width"))%>' />
                    <%--<img src='<%# Eval("Url")%>' alt='<%# Eval("Type")%>' width='100'  />--%>
                 </a>
                 
            </td>
        </ItemTemplate>
    </asp:ListView>
    
    
    <script runat="server">
        public int ItemCount { get; set; }
        public bool IsGroupItem { get; set; }
        
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            imgListView.DataSource = this.ViewData;
            imgListView.DataBind();
        }

   
</script>